const noop = () => {
};

/* eslint-disable */
module.exports = function (redisClient, module) {
    module.listPrepend = function (key, value, callback) {
        callback = callback || noop;
        if (!key) {
            return callback();
        }
        redisClient.lpush(key, value, callback);
    };

    module.listAppend = function (key, value, callback) {
        callback = callback || noop;
        if (!key) {
            return callback();
        }
        redisClient.rpush(key, value, callback);
    };

    module.listRemoveLast = function (key, callback) {
        callback = callback || noop;
        if (!key) {
            return callback();
        }
        redisClient.rpop(key, callback);
    };

    module.listRemoveAll = function (key, value, callback) {
        callback = callback || noop;
        if (!key) {
            return callback();
        }
        redisClient.lrem(key, 0, value, callback);
    };

    module.listTrim = function (key, start, stop, callback) {
        callback = callback || noop;
        if (!key) {
            return callback();
        }
        redisClient.ltrim(key, start, stop, callback);
    };

    module.getListRange = function (key, start, stop, callback) {
        callback = callback || noop;
        if (!key) {
            return callback();
        }
        redisClient.lrange(key, start, stop, callback);
    };
};
/* eslint-enable */
